package json的相关操作

import groovy.json.JsonOutput

class Student {
    String name
    int ID;
}

class 将对象转换成json格式的字符串 {

    static void main(String[] args) {
        test1();
    }

    static void test1(){
        def output = JsonOutput.toJson([new Student(name: 'John',ID:1),
                                        new Student(name: 'Mark',ID:2)])
        println(output);
    }



}
